{% extends "base.html" %}

{% block javascript %}
<script type="text/javascript" src="{{MEDIA_URL}}js/flowplayer-3.2.4.min.js"></script>
<script type="text/javascript" src="{{MEDIA_URL}}js/flowplayer.playlist-3.0.8"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
{% endblock %}

{% block titulo %}Vídeo da aula{% endblock %}

{% block quadro %}
    <a href="/cadastro/aulaAlunoAulas/">Voltar</a><br/><br/>
    {% if videoAula %}
            <a   
                style="margin: 0 auto;border:1px solid red;display:block;width:425px;height:300px;"  
                id="player">
            </a> 
            <script>
                // wait for the DOM to load using jQuery
                $(function() {
                    
                    // setup player normally
                    $f("player", '{{MEDIA_URL}}video/flowplayer.swf', {
                    
                        // clip properties common to all playlist entries
                        clip: {
                            autoPlay: false,
                            baseUrl: '{{MEDIA_URL}}',
                            autoBuffering: true,
                        },
                        
                        // our playlist
                        playlist: [
                            {{videolist|safe}}                            
                        ],
                        
                        // show playlist buttons in controlbar
                        plugins: {
                            controls: {
                                playlist: true,
                                url: '{{MEDIA_URL}}video/flowplayer.controls.swf'
                            }
                        }
                    });                    
                });
            </script> 

    {% else %}
        <li>Nenhum vídeo encontrado.</li>
    {% endif %}
{% endblock %}